import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/4/14
 * Time:21:01
 **/
public class Main1 {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        System.out.println(getMaxNum(str));
    }

    /**
     * 每日一题-求得字符串中的最长数字串
     *
     * @param str
     * @return
     */
    public static StringBuffer getMaxNum(String str) {
        int curLen = 0;
        StringBuffer curNum = null;
        int maxLen = 0;
        StringBuffer maxNum = null;
        for (int i = 0; i < str.length(); i++) {
            //判断是否是数字
            if (str.charAt(i) >= 48 && str.charAt(i) <= 57) {
                //将数字加入curNum
                if (curLen == 0) {//第一个特殊处理
                    curNum = new StringBuffer(String.valueOf(str.charAt(i)));
                    curLen++;
                } else {
                    curNum.append(str.charAt(i));
                    curLen++;
                    //当当前的数字集合大于最大数字个数时，赋给最大的
                    if (curLen >= maxLen) {
                        maxLen = curLen;
                        maxNum = curNum;
                    }
                }
            } else {
                //走到这说明不是数字,将当前长度和字符串集清空
                curLen = 0;
                curNum = null;
            }
        }
        return maxNum;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String cur = "";
        String ret = "";
        int i = 0;
        for (; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch >= '0' && ch <= '9') {
                cur = cur + ch + "";
            } else {
                if (cur.length() > ret.length()) {
                    ret = cur;
                } else {
                    cur = "";
                }
            }
        }
        if (i == str.length() && cur.length() > ret.length()) {
            ret = cur;
        }
        System.out.println(ret);
    }
}
